package model

import "openapi.itspire.cn/database"

type Article struct {
	Id   		 uint64 `json:"id"`
	Title 		 string `json:"title"`
	CategoryId 	 uint8  `json:"categoryId"`
	Author	 	 string `json:"author"`
	Content	 	 string `json:"content"`
	Introduction string `json:"introduction"`
	CommentNum	 uint64 `json:"commentNum"`
	ReadingNum   uint64 `json:"readingNum"`
	Image   	 string `json:"image"`
	IsTop   	 uint8  `json:"isTop"`
	Status   	 uint8  `json:"status"`
	CreateTime   uint64 `json:"-"`
	PublishTime  uint64 `json:"publishTime"`
	UpdateTime   uint64 `json:"-"`
	DeleteTime   uint64 `json:"-"`
	CategoryName string `json:"categoryName"`
	LabelList    []ArticleLabel `json:"labelList"`
	LastArticle  map[string]interface{} `json:"lastArticle"`
	NextArticle  map[string]interface{} `json:"nextArticle"`
}

type ArticleList struct {
	Id   		 uint64 `json:"id"`
	Title 		 string `json:"title"`
	Introduction string `json:"introduction"`
	CommentNum	 uint64 `json:"commentNum"`
	ReadingNum   uint64 `json:"readingNum"`
	Image   	 string `json:"image"`
	IsTop   	 uint8  `json:"isTop"`
	PublishTime  uint64 `json:"publishTime"`
	CategoryId 	 uint8  `json:"categoryId"`
	CategoryName string `json:"categoryName"`
	FormatTime   string `json:"formatTime"`
}

type ArticleHot struct {
	Id   		 uint64 `json:"id"`
	Title 		 string `json:"title"`
	ReadingNum   uint64 `json:"readingNum"`
}

type ArticleNew struct {
	Id   		 uint64 `json:"id"`
	Title 		 string `json:"title"`
	PublishTime  uint64 `json:"publishTime"`
}

type ArticleSearch struct {
	Id   		 uint64 `json:"id"`
	Title 		 string `json:"title"`
}

type ArticleId struct {
	Id   		 uint64 `json:"id"`
	Title        string `json:"title"`
}

func (model Article) GetTableName() string {
	return database.Ins.NewScope(model).TableName()
}

